package com.chagee.store.operation.server.facade;

import com.chagee.base.utils.PaginationData;
import com.chagee.base.utils.PaginationRequest;
import com.chagee.store.operation.server.model.param.ApprovalAppealParam;
import com.chagee.store.operation.server.model.param.TaskExecutionAppealRequest;
import com.chagee.store.operation.api.request.TaskExecutionRequest;
import com.chagee.store.operation.server.model.param.ViewReasonsParam;
import com.chagee.store.operation.server.model.vo.ApprovalAppealReasonResponse;
import com.chagee.store.operation.api.response.TaskExecutionResponse;
import com.chagee.store.operation.server.service.biz.TaskExecutionBizService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName TaskExecutionFacade  //类名称
 * @Description: //类描述
 * @Author: Jacky-zhan	//作者
 * @CreateDate: 2024/7/2 17:53	//创建时间
 * @UpdateUser: Jacky-zhan  //变更者
 * @UpdateDate: 2024/7/2 17:53	//更新时间
 * @UpdateRemark: //更新的信息
 * @Version: 1.0    //版本号
 */
@Slf4j
@Service
public class TaskExecutionFacade {

	@Resource
	private TaskExecutionBizService taskExecutionBizService;

	//任务查询
	public PaginationData<TaskExecutionResponse> query(PaginationRequest<TaskExecutionRequest> request){
		return taskExecutionBizService.query(request);
	}

	/**
	 * 查询工单下的任务信息（任务的申诉状态不为空的）
	 *
	 * @param request 工单编号
	 * @return 任务信息（任务的申诉状态不为空的）
	 */
	public List<TaskExecutionResponse> queryTaskExecutionList(TaskExecutionAppealRequest request) {
		return taskExecutionBizService.queryTaskExecutionList(request);
	}

	/**
	 * PC端开早打样工单-申诉信息：审批申诉（通过/驳回）
	 *
	 * @param approvalAppealParam 审批入参
	 * @return true/false
	 */
	public Boolean approvalAppeals(ApprovalAppealParam approvalAppealParam) {
		return taskExecutionBizService.approvalAppeals(approvalAppealParam);
	}

	/**
	 * PC端开早打样工单-申诉信息：查看驳回的原因/申诉原因
	 *
	 * @param viewReasonsParam 审批入参
	 * @return 申诉（驳回）原因证明
	 */
	public ApprovalAppealReasonResponse viewReasons(ViewReasonsParam viewReasonsParam) {
		return taskExecutionBizService.viewReasons(viewReasonsParam);
	}
}
